package com.yanqu.road.server.manger.activity.apprentice.pb;

import com.yanqu.road.entity.activity.apprentice.config.ApprenticeLevelConfig;
import com.yanqu.road.entity.activity.apprentice.config.ApprenticeProjectConfig;
import com.yanqu.road.pb.activity.ApprenticeProto;

public class ApprenticePb {

    /**
     * 等级配置
     * @param config
     * @return
     */
    public static ApprenticeProto.ApprenticeLevelConfig.Builder buildLevelConfig(ApprenticeLevelConfig config) {
        ApprenticeProto.ApprenticeLevelConfig.Builder builder = ApprenticeProto.ApprenticeLevelConfig.newBuilder();
        builder.setId(config.getId());
        builder.setExp(config.getExp());
        builder.setProjectNum(config.getProjectNum());
        builder.setChooseNum(config.getChooseNum());
        builder.setWeight(config.getWeight());
        builder.setConsume(config.getConsume());
        builder.setTestInterval(config.getTestInterval());
        builder.setTestParam(config.getTestParam());
        builder.setTestReward(config.getTestReward());
        return builder;
    }

    /**
     * 项目配置
     * @param config
     * @return
     */
    public static ApprenticeProto.ApprenticeProjectConfig.Builder buildProjectConfig(ApprenticeProjectConfig config) {
        ApprenticeProto.ApprenticeProjectConfig.Builder builder = ApprenticeProto.ApprenticeProjectConfig.newBuilder();
        builder.setId(config.getId());
        builder.setType(config.getType());
        builder.setParam(config.getParam());
        builder.setScore(config.getScore());
        builder.setContinueRound(config.getContinueRound());
        builder.setWeight(config.getWeight());
        builder.setName(config.getName());
        builder.setDesc(config.getDesc());
        builder.setPlace(config.getPlace());
        builder.setPlaceName(config.getPlaceName());
        builder.setPlaceDesc(config.getPlaceDesc());
        builder.setSort(config.getSort());
        builder.setTriggerTime(config.getTriggerTime());
        builder.setIcon(config.getIcon());
        builder.setSuggestConflict(config.getSuggestConflict());
        builder.setIdleName(config.getIdleName());
        builder.setIsNeedShadow(config.getIsNeedShadow());
        builder.setSoundResourceId(config.getSoundResourceId());
        return builder;
    }
}
